import {
  feedback
} from '../../../utils/api'
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    info:''
  },
  toAddTeam(e) {
    let userId = app.globalData.userId
    let content = e.detail.value.textarea
    let obj = {
      content
    }
    this.setData({
      info:content
    })
    if (content.length === 0) {
      wx.showToast({
        title: '请输入您的意见!',
        icon: 'error',
      })
    } else {
      feedback(userId, obj).then((res) => {
        wx.showToast({
          title: '谢谢您的反馈',
          icon: 'success',
          duration:800,
        })
      }).then(()=>{
        this.setData({
          info: ''
        })
        setTimeout(()=>{
          wx.navigateBack({
            delta: 2,
          })
        },800)
      })
    }
  },

})
